﻿<%<hi:common_new_header runat="server" skinname="/ascx/JsNewTags/Skin-Common_New_Header.ascx" />%>
<form runat="server" id="form1">
    <link href="http://res.juseshop.com/templates/master/jusekeji/style/User_Personal.css" rel="stylesheet" />
    <div class="advice clearfix">
        <div class="advice_nav clearfix"><p><hi:siteurl urlname="user_UserCenter" runat="server" class="advice_nav_one">用户中心</hi:siteurl>><a href="#">个人设置</a>>修改密码</p></div>
        <div class="advice_left clearfix">
            <hi:wnxd_user_menu runat="server" />
        </div>
        <div class="xiugai_right clearfix">
            <div class="xiugai_right_nav clearfix">
                <h1>修改登录密码</h1>
            </div>
            <!--<%<Hi:SmallStatusMessage id="Status" runat="server" Width="200" Visible="False" />%>-->
            <div class="xiugai_right_connter clearfix">
                <ul>
                    <li><div class="xiugai_right_connter_yop"><span>当前登录密码：</span><%<asp:TextBox ID="txtOdlPassword" runat="server" TextMode="Password" />%><i id="icurpwd" style="display:none"><img src="http://image.juseshop.com/images\/index/tgo (2).png" />当前登录密码不能为空</i><i id="icurpwderror" style="display:none"><img src="http://image.juseshop.com/images\/index/tgo (2).png" />原密码错误</i></div></li>
                    <li>
                        <div class="xiugai_right_connter_yop"><span>新登入密码：</span><%<asp:TextBox ID="txtNewPassword" runat="server" TextMode="Password" onkeyup="pwdStrength(this.value)" onblur="pwdStrength(this.value)" />%><i id="inewpwd" style="display:none"><img src="http://image.juseshop.com/images\/index/tgo (2).png" />密码范围在6~16位之间</i><i id="inewpwdok" style="display:none"><img src="http://image.juseshop.com/images\/index/tgo (1).png" /></i></div>
                        <div class="xiugai_right_connter_yop1"><p><a href="#" id="strength_L">弱</a><a href="#" id="strength_M">中</a><a id="strength_H" href="#">强</a></p></div>
                    </li>
                    <li>
                        <div class="xiugai_right_connter_yop"><span>确认新密码：</span><%<asp:TextBox ID="txtNewPassword2" runat="server" TextMode="Password" class="userInput" />%><i id="isurepwd" style="display:none"><img src="http://image.juseshop.com/images\/index/tgo (2).png" />两次密码填写不一致</i></div>

                    </li>



                </ul>
            </div>
            <div class="xiugai_right_connter_oo  clearfix">
                <p>
                    <!--<a prefix="wnxd_Ajax" onclick="Save">确认</a><a href="#">重  置</a>--><%<asp:Button ID="btnChangePassword" runat="server" ValidationGroup="valsProfile1" Text="确定" />%>&nbsp;
                    <input type="button" id="btnReset" value="重置" onclick="btnClear()" />
                </p>

            </div>
            <script language="javascript" type="text/javascript">
                function validator() {
                    if ($.trim($("#updatePwd_txtOdlPassword").val()) == "") {
                        $("#icurpwd").show();
                        $("#updatePwd_txtOdlPassword").focus();
                        return false;
                    }
                    else {
                        $("#icurpwd").hide();
                    }
                    if ($.trim($("#updatePwd_txtNewPassword").val()).length < 6) {
                        $("#inewpwd").show();
                        $("#inewpwdok").hide();
                        $("#updatePwd_txtNewPassword").focus();
                        return false;
                    }
                    else {
                        $("#inewpwd").hide();
                        $("#inewpwdok").show();
                    }
                    if ($.trim($("#updatePwd_txtNewPassword").val()) != $.trim($("#updatePwd_txtNewPassword2").val())) {
                        $("#isurepwd").show();
                        $("#updatePwd_txtNewPassword2").focus();
                        return false;
                    }
                    else {
                        $("#isurepwd").hide();
                    }
                }
                function btnClear() {
                    document.getElementById("updatePwd_txtOdlPassword").value = "";
                    document.getElementById("updatePwd_txtNewPassword").value = "";
                    document.getElementById("updatePwd_txtNewPassword2").value = "";
                    $("#strength_L").removeClass("abc");
                    $("#strength_M").removeClass("abc");
                    $("#strength_H").removeClass("abc");
                    $("#inewpwd").hide();
                    $("#inewpwdok").hide();
                    $("#isurepwd").hide();
                }
                $(function () {
                    $("#updatePwd_txtOdlPassword").change(function () {
                        if ($.trim($("#updatePwd_txtOdlPassword").val()) == "") {
                            $("#icurpwd").show();
                            $("#icurpwderror").hide();
                            $("#updatePwd_txtOdlPassword").focus();
                            return false;
                        }
                        else {
                            $("#icurpwd").hide();
                        }
                        $.ajax({
                            url: "/API/VshopProcess.ashx",
                            type: 'post', dataType: 'json', timeout: 10000,
                            data: {
                                action: "CheckOldPwd",
                                oldpwd: $.trim($("#updatePwd_txtOdlPassword").val()),
                                newpwd: "123456",//任意设置
                            },
                            success: function (resultData) {
                                if (!resultData.success) {
                                    $("#icurpwd").hide();
                                    $("#icurpwderror").show();
                                    $("#updatePwd_txtOdlPassword").focus();
                                } else {
                                    $("#icurpwderror").hide();
                                }
                            }
                        });
                    });
                    $("#updatePwd_txtNewPassword").change(function () {
                        if ($.trim($(this).val()).length < 6) {
                            $("#inewpwd").show();
                            $("#inewpwdok").hide();
                            $(this).focus();
                        }
                        else {
                            $("#inewpwd").hide();
                            $("#inewpwdok").show();
                        }
                    });
                    $("#updatePwd_txtNewPassword2").change(function () {
                        if ($.trim($(this).val()) != $.trim($("#updatePwd_txtNewPassword").val())) {
                            $("#isurepwd").show();
                            $(this).focus();
                        }
                        else {
                            $("#isurepwd").hide();
                        }
                    });
                    $("#updatePwd_btnChangePassword").click(function () {
                        return validator();
                    });
                });
                function pwdStrength(pwd) {
                    O_color = "#eeeeee";
                    L_color = "#FF0000";
                    M_color = "#FF9900";
                    H_color = "#33CC00";
                    var level = 0, strength = "O";
                    if (pwd == null || pwd == '') {
                        strength = "O";
                        Lcolor = Mcolor = Hcolor = O_color;
                    }
                    else {
                        var mode = 0;
                        if (pwd.length <= 5)
                            mode = 0;
                        else {
                            for (i = 0; i < pwd.length; i++) {
                                var charMode, charCode;
                                charCode = pwd.charCodeAt(i);
                                // 判断输入密码的类型
                                if (charCode >= 48 && charCode <= 57) //数字
                                    charMode = 1;
                                else if (charCode >= 65 && charCode <= 90) //大写
                                    charMode = 2;
                                else if (charCode >= 97 && charCode <= 122) //小写
                                    charMode = 4;
                                else
                                    charMode = 8;
                                mode |= charMode;
                            }
                            // 计算密码模式
                            level = 0;
                            for (i = 0; i < 4; i++) {
                                if (mode & 1)
                                    level++;
                                mode >>>= 1;
                            }
                        }
                        switch (level) {
                            case 0:
                                strength = "O";
                                Lcolor = Mcolor = Hcolor = O_color;
                                break;
                            case 1:
                                strength = "L";
                                Lcolor = L_color;
                                Mcolor = Hcolor = O_color;
                                break;
                            case 2:
                                strength = "M";
                                Lcolor = Mcolor = M_color;
                                Hcolor = O_color;
                                break;
                            default:
                                strength = "H";
                                Lcolor = Mcolor = Hcolor = H_color;
                                break;
                        }
                    }
                    //document.getElementById("strength_L").style.background = Lcolor;
                    //document.getElementById("strength_M").style.background = Mcolor;
                    //document.getElementById("strength_H").style.background = Hcolor;
                    if (strength == "L") {
                        $("#strength_L").addClass("abc");
                        $("#strength_M").removeClass("abc");
                        $("#strength_H").removeClass("abc");
                    } else if (strength == "M") {
                        $("#strength_L").removeClass("abc");
                        $("#strength_M").addClass("abc");
                        $("#strength_H").removeClass("abc");
                    } else if (strength == "H") {
                        $("#strength_L").removeClass("abc");
                        $("#strength_M").removeClass("abc");
                        $("#strength_H").addClass("abc");
                    } else {
                        $("#strength_L").removeClass("abc");
                        $("#strength_M").removeClass("abc");
                        $("#strength_H").removeClass("abc");
                    }
                    return strength;
                }
            </script>
            <div class="xiugai_right_connter_ts clearfix">
                <div class="xiugai_right_connter_ts_left clearfix">
                    <span>提示：</span>
                </div>
                <div class="xiugai_right_connter_ts_right clearfix">
                    <p>
                        密码保护功能可以保障您的会员名更安全，当密码发生问题时，能帮您更安全快捷的取回。<br />
                        请一定要在"个人信息"填写并牢记您的安全邮箱以便接收您的密码。包括安全邮箱在内的密码保护信息，系统不会对外公开。<br />
                        请您认真填写密码保护的问题，要牢记填写的每项内容，以便系统将根据该资料为您提供“修改密码”、“取回密码”服务。
                    </p>
                </div>
            </div>
        </div>

    </div>
</form>
    <%<hi:common_new_footer runat="server" />%>
